<template>
  <div class="con">
      <div class="header">
          <van-nav-bar title="拼团" left-text="返回"  right-text="分享" left-arrow class="spec" @click-right='share()' @click-left='tab1()'>
           <van-icon name="cluster-o" slot="right"  />
           
            </van-nav-bar>
            <van-action-sheet v-model="show" title="分享到" height:30>
                <div class="share">
                    <share :config='config'></share>
                </div>
            </van-action-sheet>
      </div>
      

    <div class="main">
        <div class="banner">
            <img src="../assets/p2.gif" alt="">
        </div>
        <div class="main-con">
            <div class="main-self" v-for="(item,i) in list" :key="i">
                <div class="main-self-wrap">
                    <img :src="item.pimg" alt="">
                </div>
                <h2>{{item.pname}}</h2>
                <p>推荐理由:{{item.pdesc}}</p>
                <div class="main-self-bottom">
                    <div class="gorob">
                        <div class="gorob-left">
                            <div class="gorob-left-left">
                                <span>2人</span>
                                <em>成团价</em>
                            </div>
                            <div class="gorob-line">
                                
                            </div>
                            <div class="gorob-left-right">
                                <span>￥{{item.tjprice}}</span>
                                <em>￥{{item.pprice}}</em>
                                <i class="x-line"></i>
                            </div>
                        </div>
                        <div class="gorob-right" @click="tab2(item.pid)">
                            去拼单
                        </div>
                    </div>
                    <span style="margin-top:5px">仅剩一天</span>
                </div>
            </div>
        </div>
    </div>
  </div>
</template>

<script>
import * as api from '../../api/getproductlist'
export default {
    name:'Assemble',
      methods:{
        tab(){
           this.$toast('分享');
        },
        tab1(){
            this.$router.go(-1)
        },
        tab2(id){
            this.$router.push('/goass/'+id)
        },
        share(){
            this.show=true
        }
    },
     data(){
        return{
            show:false,
            list:[],
            config:{
                url: 'http://www.baidu.com', // 网址，默认使用 window.location.href
		source:'', // 来源（QQ空间会用到）, 默认读取head标签：<meta name="site" content="http://overtrue" />
		title: 'hello', // 标题，默认读取 document.title 或者 <meta name="title" content="share.js" />
		description: 'hi', // 描述, 默认读取head标签<meta name="description" content="PHP弱类型的实现原理分析" />
		image : '', // 图片, 默认取网页中第一个img标签
		sites: ['qq', 'weibo','qzone' ,], // 启用的站点
		wechatQrcodeTitle: '微信扫一扫：分享', // 微信二维码提示文字
		wechatQrcodeHelper  : '<p>微信里点“发现”，扫一下</p><p>二维码便可将本文分享至朋友圈。</p>'

            }
        }
    },
    mounted(){
        api.gettjpro({}).then(data=>{
            this.list=data.data.data
        })
    }
}
</script>

<style scoped>
.social-share{
    display: flex;
    justify-content: space-between;
    padding: 0 38px
}
.share{
    height: 100px;
}
.gorob-left-right{
    position: relative;
}
.gorob-left-right span{
    color: red;
    position: absolute;
    font-size: 14px;
    left: 5px;
    top: 10px
}
.x-line{
    width: 30px;
    height: 1px;
    display: block;
    position: absolute;
    left: 12px;
    top: 38px;
    background: #000
}
.gorob-left-right em{
    color: #565656;
    position: absolute;
    left: 5px;
    top: 30px;
    font-style:normal;
}

.gorob-line{
    width: 0.5px;
    height: 80%;
    background: #666;
    position: absolute;
    left: 54px;
    bottom: 5px
}
.gorob-left-left{
    display: flex;
    width: 40%;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center
}
.gorob-left-left span{
    color: red;
    font-size: 11px;
    font-weight: 600;
}
.gorob-left-left em{
    color: #000;
    font-style: normal;
    margin-top: 5px;
    font-size: 11px;
    font-weight: 600;
}
.main-self-bottom{
    display: flex;
    align-items: center;
    justify-content: space-between
}
.gorob-left{
    width: 155px;
    height: 60px;
    border: 1px solid red;
    border-radius:  30px 0  0 30px;
    box-sizing: border-box;
    display: flex
}
.gorob-right{
     width: 75px;
    height: 60px;
   background:#f8771a;
    border-radius:   0 30px  30px 0 ;
    text-align: center;
    line-height: 60px;
    color: #ffff;
    font-size: 14px;
    font-weight: 510;
}
.gorob{
    display: flex;
    align-items: center;
    margin-top: 10px;
    position: relative;
}
.main-self-wrap{
    width: 100%;
    height: 200px;
    background: pink
}
.main-self-wrap img{
    width: 100%;
    height: 100%;
    display: inline-block;
}
.main-self{
    padding: 12px;
    background: #fff;
    margin-bottom: 10px
}
.main-self h2,p{
    margin: 0;
}
.main-self h2{
    height: 24px;
    line-height: 24px;
    font-size: 15px;
    margin-bottom: 5px;
    margin-top: 10px
}
.main-self p{
    color:#565656;
    font-size: 10px;
    border-bottom: 1px solid #f3f3f3;
    padding-bottom: 10px
}
.van-nav-bar__text{
    color: #000
}
.van-nav-bar .van-icon{
    color: #333;
    margin-top: 3px
}
.van-nav-bar__title{
    font-size: 15px
}
.con{
    display: flex;
    flex-direction: column;
    background:#f3f3f3;
    height: 100vh;
}
.main{
    flex: 1;
    overflow: auto
}
.banner{
    width: 100%;
    height: 150px;
    background: pink
}
.banner img{
    width: 100%;
    height: 100%;
    display: inline-block
}
</style>